Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce pelikan_bloomcache #468

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

swlynch99
Copy link
Contributor

@swlynch99 swlynch99 commented Sep 30, 2022

This is code-complete and lightly tested. I haven't tested this beyond some basic smoke tests but ultimately the code is pretty simple.

@swlynch99 swlynch99 mentioned this pull request Oct 3, 2022

/// The number of hash functions that are evaluated for each value inserted.F
#[serde(default = "hashes")]
pub hashes: usize,

This comment was marked as spam.

@@ -0,0 +1,42 @@
// Copyright 2021 Twitter, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2022

#[serde(default = "size")]
pub size: usize,

/// The number of hash functions that are evaluated for each value inserted.F
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

protocol-http = { path = "../protocol/http" }
seg = { path = "../storage/seg" }
bloom = { path = "../storage/bloom" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer alphabetical ordering

@@ -0,0 +1,54 @@
// Copyright 2021 Twitter, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2022

// http://www.apache.org/licenses/LICENSE-2.0

use protocol_common::Execute;
use protocol_http::{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not use this style here and would prefer two use statements.

@@ -0,0 +1,34 @@
// Copyright 2021 Twitter, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2022

impl Bloom {
/// Create a bloom filter storage based on the config.
pub fn new<T: BloomConfig>(config: &T) -> Result<Self, std::io::Error> {
// TODO: Validate the config here and return an error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally we've been putting names on the TODOs - eg: TODO(bmartin):

@@ -0,0 +1,51 @@
// Copyright 2021 Twitter, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2022

@@ -0,0 +1,96 @@
// Copyright 2021 Twitter, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2022

fn main() {
// custom panic hook to terminate whole process after unwinding
std::panic::set_hook(Box::new(|s| {
error!("{}", s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to eprintln please. We don't guarantee the log is flushed before terminating and having the error message lost is not a great experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants